package com.bdqn.t320.service;

import com.bdqn.t320.aop.UserServiceLogger;
import com.bdqn.t320.dao.UserDao;
import com.bdqn.t320.dao.UserDaoImp;
import com.bdqn.t320.pojo.User;

public class UserServiceImp implements UserService {
    //private UserDao userDao = new UserDaoImp();
    private UserDao userDao;

    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }
    //aop的目的是从系统中分离出切面，独立于业务逻辑实现在程序执行时织入程序中运行

    public int saveService(User user) {
        //System.out.println(1/0);
        return userDao.add(user);
    }

    public void log(){
        System.out.println("记录用户增加的service操作时间");
    }

    public void print(){
        System.out.println("aaaaaaaaaaaaaaaaaa");
    }
}
